﻿using System;
using System.Collections.Generic;
using System.Text;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;

namespace shudiangis.Common
{
    public class UserFeatureOperation
    {
        public static ILayer AddFeature(IWorkspace workSpace,string strTableName)
        {
            IFeatureClass pFeatureClass = UserDatabaseOperation.GetFeature(workSpace, strTableName);

            IDataset pDataset = pFeatureClass as IDataset;

            IFeatureLayer pFeatureLayer = new FeatureLayerClass();
            pFeatureLayer.FeatureClass = pFeatureClass;
            pFeatureLayer.Name = pDataset.Name;

            ILayer pLayer = pFeatureLayer as ILayer;
            return pLayer;
        }
    }
}
